
import request from '@/utils/request'

//获取该课程所有学生成绩
export function getCourseRecordsAPI(courseId) {
    return request({
        url: '/gradeRecords/getByCourseId/' + courseId,
        method: 'GET',
    })
}

// 通过课程id和学生id获取成绩单信息
//  /gradeRecords/{courseId}/{studentId}
export function getSudentCourseRecordAPI(courseId, studentId) {
    return request({
        url: '/gradeRecords/' + courseId + '/' + studentId,
        method: 'GET',
    })
}

// 添加成绩单
//  /gradeRecords/{courseId}/{studentId}
export function addSudentCourseRecordAPI(data) {
    return request({
        url: '/gradeRecords',
        method: 'POST',
        data
    })
}

// 成绩单修改 
// /gradeRecords
export function editSudentCourseRecordAPI(data) {
    return request({
        url: '/gradeRecords',
        method: 'PUT',
        data
    })
}

// 成绩单删除接口 (把该生从课程移除)
// /gradeRecords/{gradeRecordId}
export function deleteSudentCourseRecordAPI(gradeRecordId) {
    return request({
        url: '/gradeRecords/' + gradeRecordId,
        method: 'DELETE',
    })
}